/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package music.Chords;

import java.util.Vector;
import music.types.Interval;
import music.types.IntervalHolder;
import music.types.MidiNote;

/**
 *
 * @author TJ
 */
public class ChordInfo {
    private ChordQuality quality=ChordQuality.MAJOR;
    private MidiNote root;
    private IntervalQuality third=IntervalQuality.MAJOR,fifth=IntervalQuality.MAJOR;
    private String name;
    private int inversion;
    
    private int octave=0;
    private Vector<IntervalHolder> addedIntervals;
    public ChordInfo(String name) {
        init();
    }
    public ChordInfo() {
        init();
    }
    private void init(){
        addedIntervals=new Vector<IntervalHolder>();
    }
    public static ChordInfo getChordInfo(Vector<MidiNote> v) {
        return null;
    }

    
    public Chord getChord(){return null;}
    public void setChordQuality(ChordQuality q) {
        quality=q;
        third=ChordQuality.getThird(q);
        fifth=ChordQuality.getFifth(q);
    }
    public void setThird(IntervalQuality q) {third=q;}
    public void setFifth(IntervalQuality q) {fifth=q;}
    public void setRoot(MidiNote n) {root=n;}
    public void setRoot(String s){}
    public boolean isAugmented() {return false;}
    public boolean isDiminished() {return false;}
    public boolean isMajor() {return false;}
    public boolean isMinor() {return false;}
    public ChordQuality getChordQuality(){return quality;}
    public Vector<IntervalHolder> getAddedIntervals(){return addedIntervals;}
    public MidiNote getRoot(){return root;}
    public IntervalQuality getThird(){return third;}
    public IntervalQuality getFifth(){return fifth;}
    public int getOctave(){return octave;}
    public int getInversion(){return inversion;}
    public void addInterval(IntervalHolder i){
        if(!addedIntervals.contains(i)) {
            addedIntervals.add(i);
        }
    };
    public void addInterval(IntervalQuality q, int i){
        Interval i2=Interval.getInterval(q, i);
        if(i2!=null){addedIntervals.add(new IntervalHolder(i2,i));}
    }
    public void removeInterval(IntervalHolder i) {addedIntervals.remove(i);}
    public void invert() {inversion++;}
    public void raiseOctave() {octave++;}
    public void lowerOctave() {octave--;}
}
